{% extends 'admin/common/base.html' %}
{% block css %}
{{super()}}
<link href="{{url_for('admin.static',filename='ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css')}}" rel="stylesheet"/>
{% endblock %}
{% block body %}
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form">
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">名称：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="name" id="name" value="" required>
				</div>
			</div>
            <div class="form-group">
				<label class="col-sm-3 control-label is-required">模块名称：</label>
				<div class="col-sm-8">
					<select name="model" id="model" class="form-control" required>
						{% for name in models %}
						<option value="{{name}}">{{name}}</option>
						{% endfor %}
					</select>
				</div>
			</div>
		</form>
	</div>
</body>
{% endblock %}
{% block js %}
{{ super() }}
<script src="{{url_for('admin.static',filename='ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js')}}"></script>
<script type="text/javascript">
    var ctx = '';
    
    $("#form").validate({
        rules:{
            onkeyup: false,
        },
        focusCleanup: true
    });
    
    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save("{{url_for('admin.sys.gencode.add')}}", $('#form').serialize());
        }
    }
</script>
{% endblock %}
